package henry.flink.demo;

import org.apache.flink.api.java.tuple.Tuple3;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class DataSource {

    /**
     * 示例数据集合
     * Tuple3 是一个固定3个属性变量的实体类，分别用f0,f1,f2表示三个构造传参与变量
     *
     * @return
     */
    public static List<Tuple3<String, String, Integer>> getTuple3ToList() {
        //Tuple3<f0,f1,f2> = Tuple3<姓名，性别（man男，girl女），年龄>
        return Arrays.asList(
                new Tuple3<>("张三", "man", 20),
                new Tuple3<>("张九零", "man", 20),
                new Tuple3<>("张无忌", "man", 20),
                new Tuple3<>("李四", "girl", 24),
                new Tuple3<>("李四海", "girl", 24),
                new Tuple3<>("王五", "man", 29),
                new Tuple3<>("王五琪", "man", 29),
                new Tuple3<>("刘六", "girl", 32),
                new Tuple3<>("刘六腰", "girl", 32),
                new Tuple3<>("伍七", "girl", 18),
                new Tuple3<>("伍六七", "girl", 18),
                new Tuple3<>("吴八", "man", 30),
                new Tuple3<>("吴八醒", "man", 30)
        );
    }

    public static List<String> getPersonJsonList() {
        return Arrays.asList(
                "{\"name\":\"张三丰\",\"sex\":\"男\",\"age\":\"68\"}",
                "{\"name\":\"张无忌\",\"sex\":\"女\",\"age\":\"61\"}",
                "{\"name\":\"张九龄\",\"sex\":\"男\",\"age\":\"62\"}",
                "{\"name\":\"张惠妹\",\"sex\":\"女\",\"age\":\"63\"}",
                "{\"name\":\"张雨生\",\"sex\":\"男\",\"age\":\"63\"}",
                "{\"name\":\"张梦迪\",\"sex\":\"女\",\"age\":\"65\"}",
                "{\"name\":\"张腾华\",\"sex\":\"男\",\"age\":\"69\"}",
                "{\"name\":\"张江时\",\"sex\":\"男\",\"age\":\"61\"}"
        );
    }

}